package com.internetCafes.spms.web.customer.mapper.customer;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.internetCafes.spms.web.customer.entity.customer.CustomerFlow;
import com.internetCafes.spms.web.customer.model.customer.flow.CustomerFlowDo;
import com.internetCafes.spms.web.customer.model.customer.flow.CustomerFlowPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 客户流转表 Mapper 接口
 * </p>
 *
 * @author Zj
 * @since 2021-10-20
 */
@Mapper
public interface CustomerFlowMapper extends BaseMapper<CustomerFlow> {

    /**
     * 获取最近的
     *
     * @param customerIdList 客户id列表
     * @return 客户跟进列表
     */
    List<CustomerFlowPo> listTransferPoRecent(@Param("customerIdList") List<Long> customerIdList);

    /**
     * 获取客户列表
     *
     * @param customerFlowDo 请求参数
     * @return 客户操作列表
     */
    @SqlParser(filter = true)
    List<CustomerFlowPo> poList(@Param("customerFlowDo") CustomerFlowDo customerFlowDo);

    /**
     * 分页
     */
    Page<CustomerFlow> paging(IPage<CustomerFlow> page, @Param("ew") Wrapper<CustomerFlow> queryWrapper);
}
